CREATE TABLE ##Temp_6d3cdaea_68e7_4a08_b42d_28e89e055636 (listId uniqueidentifier)

INSERT ##Temp_6d3cdaea_68e7_4a08_b42d_28e89e055636 (listId)


select [Lists].[tp_ID] from [Lists] WITH (NOLOCK) where ([tp_Title] = 'TypedList' and tp_Flags & 0x100 = 0x0 and [tp_WebId] in (SELECT Id
		FROM Webs
		WHERE (FullUrl LIKE '' + '%') OR (FullUrl LIKE '')))


SELECT tp_Fields
FROM ALlLists
WHERE tp_ID in (SELECT TOP(1) listId FROM ##Temp_6d3cdaea_68e7_4a08_b42d_28e89e055636)